<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use App\Framework\Model\ManagerPermission;
use App\Framework\Model\ManagerModule;

Route::get('/', function () {
    return view('welcome');
});

Route::get('/common/getcaptcha', 'CommonController@getCaptcha');
Route::get('/common/nopower', 'CommonController@noPower');

Route::group(['prefix' => 'rzjhp999'], function ($router) {
    Route::get('/login', 'AdminController@login');
    Route::post('/postlogin', 'AdminController@postlogin');
    Route::get('/logout', 'AdminController@logout');
});


Route::group(['prefix' => 'rzjhp999', 'middleware' => 'ManagerAuth'], function ($router) {
    //首页
    Route::get('/todo', 'AdminController@todo');
    Route::get('/', 'AdminController@index');
    Route::get('/innerIndex', 'AdminController@innerIndex');
    //管理员角色
    Route::get('/getManagerRoleList', 'AdminController@getManagerRoleList')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::READ);
    Route::get('/addManagerRole', 'AdminController@addManagerRole')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::ADD);
    Route::post('/storeManagerRole', 'AdminController@storeManagerRole')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::ADD);
    Route::get('/editManagerRole/{id}', 'AdminController@editManagerRole')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::EDIT);
    Route::post('/updateManagerRole', 'AdminController@updateManagerRole')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::EDIT);
    Route::get('/setPermission/{id}', 'AdminController@setPermission')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::EDIT);
    Route::post('/storePermission', 'AdminController@storePermission')->middleware('ManagerPower:' . ManagerModule::ROLE_MANAGE . ',' . ManagerPermission::EDIT);
    //管理员管理
    Route::get('/getManagerList', 'AdminController@getManagerList')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::READ);
    Route::get('/addManager', 'AdminController@addManager')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::ADD);
    Route::post('/storeManager', 'AdminController@storeManager')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::ADD);
    Route::get('/editManager/{id}', 'AdminController@editManager')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::EDIT);
    Route::post('/updateManager', 'AdminController@updateManager')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::EDIT);
    Route::post('/deleteManager', 'AdminController@deleteManager')->middleware('ManagerPower:' . ManagerModule::MANAGER_MANAGE . ',' . ManagerPermission::DELETE);
    //后台日志
    Route::get('/getManagerLoginLog', 'AdminController@getManagerLoginLog')->middleware('ManagerPower:' . ManagerModule::LOGIN_LOG . ',' . ManagerPermission::READ);
    Route::get('/getManagerHandleLog', 'AdminController@getManagerHandleLog')->middleware('ManagerPower:' . ManagerModule::HANDLE_LOG . ',' . ManagerPermission::READ);
    //活动管理
    Route::get('/game/getActivityList', 'GameController@getActivityList')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::READ);
    Route::get('/game/addActivity', 'GameController@addActivity')->middleware('ManagerPower:' . ManagerModule::ADD_ACTIVITY . ',' . ManagerPermission::ADD);
    Route::post('/game/storeActivity', 'GameController@storeActivity')->middleware('ManagerPower:' . ManagerModule::ADD_ACTIVITY . ',' . ManagerPermission::ADD);
    Route::get('/game/editActivity/{id}', 'GameController@editActivity')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::EDIT);
    Route::post('/game/updateActivity', 'GameController@updateActivity')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::EDIT);
    Route::post('/game/setActivitySortUp', 'GameController@setActivitySortUp')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::EDIT);
    Route::post('/game/setActivitySortDown', 'GameController@setActivitySortDown')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::EDIT);
    Route::post('/game/deleteActivity', 'GameController@deleteActivity')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::DELETE);
    Route::post('/game/batchDeleteActivity', 'GameController@batchDeleteActivity')->middleware('ManagerPower:' . ManagerModule::ACTIVITY_RECORD . ',' . ManagerPermission::DELETE);
    //商品管理
    Route::get('/game/getProductList', 'GameController@getProductList')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::READ);
    Route::get('/game/addProduct', 'GameController@addProduct')->middleware('ManagerPower:' . ManagerModule::ADD_PRODUCT . ',' . ManagerPermission::ADD);
    Route::post('/game/storeProduct', 'GameController@storeProduct')->middleware('ManagerPower:' . ManagerModule::ADD_PRODUCT . ',' . ManagerPermission::ADD);
    Route::get('/game/editProduct/{id}', 'GameController@editProduct')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::EDIT);
    Route::post('/game/updateProduct', 'GameController@updateProduct')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::EDIT);
    Route::post('/game/setProductSortUp', 'GameController@setProductSortUp')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::EDIT);
    Route::post('/game/setProductSortDown', 'GameController@setProductSortDown')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::EDIT);
    Route::post('/game/deleteProduct', 'GameController@deleteProduct')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::DELETE);
    Route::post('/game/batchDeleteProduct', 'GameController@batchDeleteProduct')->middleware('ManagerPower:' . ManagerModule::PRODUCT_LIST . ',' . ManagerPermission::DELETE);
    //兑换记录
    Route::get('/game/getExchangeRecordList', 'GameController@getExchangeRecordList')->middleware('ManagerPower:' . ManagerModule::EXCHANGE_RECORD . ',' . ManagerPermission::READ);
    Route::get('/game/getExchangeRecordDetail/{id}', 'GameController@getExchangeRecordDetail')->middleware('ManagerPower:' . ManagerModule::EXCHANGE_RECORD . ',' . ManagerPermission::READ);
    Route::post('/game/updateExchangeRecord', 'GameController@updateExchangeRecord')->middleware('ManagerPower:' . ManagerModule::EXCHANGE_RECORD . ',' . ManagerPermission::EDIT);
    Route::post('/game/setExchangeRecordStatus', 'GameController@setExchangeRecordStatus')->middleware('ManagerPower:' . ManagerModule::EXCHANGE_RECORD . ',' . ManagerPermission::EDIT);
    Route::get('/game/getSinglePage', 'GameController@getSinglePage')->middleware('ManagerPower:' . ManagerModule::SINGLE_PAGE . ',' . ManagerPermission::EDIT);
    Route::post('/game/updateSinglePage', 'GameController@updateSinglePage')->middleware('ManagerPower:' . ManagerModule::SINGLE_PAGE . ',' . ManagerPermission::EDIT);
    //用户反馈
    Route::get('/game/getUserFeedbackList', 'GameController@getUserFeedbackList')->middleware('ManagerPower:' . ManagerModule::USER_FEEDBACK . ',' . ManagerPermission::READ);
    Route::get('/game/getUserFeedbackDetail', 'GameController@getUserFeedbackDetail')->middleware('ManagerPower:' . ManagerModule::USER_FEEDBACK . ',' . ManagerPermission::READ);
    Route::post('/game/deleteUserFeedback', 'GameController@deleteUserFeedback')->middleware('ManagerPower:' . ManagerModule::USER_FEEDBACK . ',' . ManagerPermission::DELETE);
    //消息
    Route::get('/game/getBroadcastList', 'GameController@getBroadcastList')->middleware('ManagerPower:' . ManagerModule::BROADCAST_LIST . ',' . ManagerPermission::READ);
    Route::get('/game/addBroadcast', 'GameController@addBroadcast')->middleware('ManagerPower:' . ManagerModule::ADD_BROADCAST . ',' . ManagerPermission::ADD);
    Route::post('/game/storeBroadcast', 'GameController@storeBroadcast')->middleware('ManagerPower:' . ManagerModule::ADD_BROADCAST . ',' . ManagerPermission::ADD);
    Route::post('/game/deleteBroadcast', 'GameController@deleteBroadcast')->middleware('ManagerPower:' . ManagerModule::BROADCAST_LIST . ',' . ManagerPermission::DELETE);
    //金币管理
    Route::get('/game/getCoinStatiList', 'GameController@getCoinStatiList')->middleware('ManagerPower:' . ManagerModule::COIN_MANAGE . ',' . ManagerPermission::READ);
});
